package com.summer.Dao;

import com.summer.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

/**
 * 作者:夏天
 * qq:1205232048
 */
public interface UserMapper {
    //查询所有用户
    @Select("select * from user")
    List<User> selectUser();

    @Select("select * from user where id = #{id}")
    User selectUserById(@Param("id") int id);

    @Insert("insert into user values(#{id},#{name},#{password})")
    int addUser(User user);

    @Update("update user set name = #{name},pwd = #{password} where id = #{id}")
    int updateUser(User user);

    @Delete("delete from user where id = #{id}")
    int deleteUser(@Param("id") int id);

}
